package com.jiayi.sofarpcbootproject;

import com.alipay.sofa.rpc.config.ProviderConfig;
import com.alipay.sofa.rpc.config.ServerConfig;
import com.jiayi.sofarpcbootproject.service.HelloService;
import com.jiayi.sofarpcbootproject.service.HelloSeviceImpl;

public class QuickStartServer {

    public static void main(String[] args) {
        ServerConfig serverConfig = new ServerConfig()
                .setProtocol("bolt")
                .setPort(9696)
                .setDaemon(false);//非守护线程

        ProviderConfig<HelloService> providerConfig = new ProviderConfig<HelloService>()
                .setInterfaceId(HelloService.class.getName()) //指定接口
                .setRef(new HelloSeviceImpl()) //指定实现
                .setServer(serverConfig);//指定服务端

        providerConfig.export(); //发布服务
    }
}
